$(document).ready(function() {

	getBanner();
	getFrontProduct();
})

function getBanner() {
	$.ajax({
		type: "post",
		url: "../api/front/getFrontPicUrl.jhtml",
		success: function(data) {
			var json = eval('(' + data + ')');
			if(json.code == "200") {
				var index = eval('(' + json.data + ')');
				$("#banner1").attr("src",picUrl+index.banner1);
				$("#banner2").attr("src",picUrl+index.banner2);
				$("#banner3").attr("src",picUrl+index.banner3);
				$("#sub_banner1").attr("src",picUrl+index.sub_banner1);
				$("#sub_banner2").attr("src",picUrl+index.sub_banner2);
				$("#sub_banner3").attr("src",picUrl+index.sub_banner3);
				$("#sub_banner4").attr("src",picUrl+index.sub_banner4);
				$("#sub_banner5").attr("src",picUrl+index.sub_banner5);
			} else {
                alert(json.msg);
			}
		}
	});
}


function getFrontProduct(){
	$.ajax({
		type: "post",
		url: "../api/front/getFrontProduct.jhtml",
		success: function(data) {
			var json = eval('(' + data + ')');
			if(json.code == "200") {
				var index = eval('(' + json.data + ')');
				//alert(index);
			} else {
                alert(json.msg);
			}
		}
	});
}
